<?php
	if (isset($_GET['index'])) {
		$file=$_GET['index'].".txt";
	}else{
		$file=$_POST['index'].".txt";
	}
	$myfile = fopen($file, "r") or die("Unable to open file : $file !");
	while(!feof($myfile)) {
		$in = explode(' ', fgets($myfile));
		foreach ($in as $key => $value) {
			$value=trim($value);
			if(preg_match("/\s/i",$value)){
				continue;
			}
			$nums[]=$value;
		}
	}
	fclose($myfile);
	$c=count($nums);
	if ($c>1) {
		$c=$c-1;
		if (isset($_POST['ls']) || isset($_GET['ls'])) {
			echo implode(' ', $nums);
		}else{
			echo "$c";
		}
	}else{
		if (isset($_POST['ls']) || isset($_GET['ls'])) {
			echo '未抽过该奖';
		}else{
			echo "0";
		}
	}
	#echo "<p>all</p>";
	#print_r($all_num);
	#echo "<p>zhongJiangHao</p>";
	#print_r($zhongJiangHao);
	#echo "<p>sy_num</p>";
	#print_r($sy_num);

?>


